package org.xm.sk.vo.ob;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.xm.sk.vo.e.BoderStatus;
import org.xm.sk.vo.tb.Boder;
import org.xm.sk.vo.tb.Item;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@ApiModel(value = "CmBoder4Hairdresser", description = "已完成订单")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CmBoder4Hairdresser {

    @ApiModelProperty(value = "订单ID")
    Integer id;

    @ApiModelProperty(value = "预约号")
    String ordernum;
    
    @ApiModelProperty(value = "客户名称")
    String username;
    
    @ApiModelProperty(value = "客户昵称")
    String nickname;
    
    @ApiModelProperty(value = "客户头像图片ID")
    Integer imageId;

    @ApiModelProperty(value = "预约门店ID")
    Integer shopId;

    @ApiModelProperty(value = "预约门店名称")
    String shopName;

    @ApiModelProperty(value = "预约项目ID集")
    Set<Integer> itemIds = new HashSet<Integer>(0);

    @ApiModelProperty(value = "预约项目名称集")
    Set<String> itemNames = new HashSet<String>(0);

    @ApiModelProperty(value = "预约电话")
    String phone;

    @ApiModelProperty(value = "消费原价")
    Double priceValue;

    @ApiModelProperty(value = "优惠券优惠金额")
    Double couponValue;

    @ApiModelProperty(value = "实付")
    Double payValue;

    @ApiModelProperty(value = "下单时间")
    Date createdate;

    @ApiModelProperty(value = "预约时间")
    Date mkTime;
    
    @ApiModelProperty(value = "服务时间")
    Date svtime;
    
    @ApiModelProperty(value = "付款时间")
    Date pytime;

    @ApiModelProperty(value = "订单状态")
    BoderStatus status;
    
    @ApiModelProperty(value = "优惠券码")
    String couponnum;

    public CmBoder4Hairdresser(Integer id, String ordernum, String username, String nickname,
            Integer imageId, Integer shopId, String shopName, Boder boder,
            String itemNs, String phone, Double priceValue, Double couponValue,
            Double payValue, Date createdate, Date mkTime, Date svtime,
            Date pytime, BoderStatus status, String couponnum) {
        this.id = id;
        this.ordernum = ordernum;
        this.nickname = nickname;
        this.username = username;
        this.imageId = imageId;
        this.shopId = shopId;
        this.shopName = shopName;
        for (Item item : boder.getItems()) {
            this.itemIds.add(item.getId());
        }
        if (null != itemNs && 0 < itemNs.length()) {
            String[] items = itemNs.split(",");
            for (String s : items) {
                this.itemNames.add(s);
            }
        }
        this.phone = phone;
        this.priceValue = priceValue;
        this.couponValue = couponValue;
        this.payValue = payValue;
        this.createdate = createdate;
        this.mkTime = mkTime;
        this.svtime = svtime;
        this.pytime = pytime;
        this.status = status;
        this.couponnum = couponnum;
    }
    
}
